#ifndef DELIVERY_PERSON_MODULE_H
#define DELIVERY_PERSON_MODULE_H

#include <map>
#include <string>

// 配送员类
class DeliveryPerson {
public:
    DeliveryPerson(int user_id, std::string phone, std::string password, std::string name)
        : user_id(user_id), phone(phone), password(password), name(name) {}

    int getUserId() const { return user_id; }
    std::string getPhone() const { return phone; }
    std::string getPassword() const { return password; }
    std::string getName() const { return name; }

    void setName(const std::string& name) { this->name = name; }

private:
    int user_id;
    std::string phone;
    std::string password;
    std::string name;
};

// 配送员模块类
class DeliveryPersonModule {
public:
    DeliveryPersonModule() {}

    bool acceptOrder(int delivery_person_id, int order_id);
    bool deliverOrder(int delivery_person_id, int order_id);
    bool viewOrders(int delivery_person_id, std::map<int, bool>& orders_map);

private:
    // 存储配送员与订单的映射关系（键：配送员ID，值：订单ID集合）
    std::map<int, std::map<int, bool>> deliveryOrders;
};

#endif